﻿@model smsgs_MVC3.Areas.Messages.Models.MessagesView

@{
    ViewBag.Title = "Messages list";
    int iMsg = 1;
    ViewDataDictionary vd = new ViewDataDictionary();

}

<h2>List of messages for @Model.User.UserNameToDisplay</h2>
@Html.ActionLink("Create new Message", "CreateNewMessage")
<fieldset>
<legend>Unread messages</legend>

<table>
<thead>
<tr>
<th>Nr</th>
<th>Subject</th>
<th>Actions</th>
</tr>
</thead>

<tbody>
@foreach (var itemUnread in Model.UnreadMessages)
{
    vd.Clear();
    vd.Add("id", iMsg++);
    <tr>

    @{Html.RenderPartial("ViewMessageSummary", itemUnread, vd);}
    </tr>
}
</tbody>
</table>
</fieldset>


<fieldset>
<legend>Read messages</legend>

<table>
<thead>
<tr>
<th>Nr</th>
<th>Subject</th>
<th>Actions</th>
</tr>
</thead>

<tbody>
@foreach (var itemRead in Model.ReadMessages)
{
    vd.Clear();
    vd.Add("id", iMsg++);
    <tr>

    @{Html.RenderPartial("ViewMessageSummary", itemRead, vd);};
    </tr>
}
</tbody>
</table>
</fieldset>

